﻿@using DevExpress.Web.Mvc.UI;
@using System.Web.UI.WebControls;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>@ViewBag.Title</title>
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/modernizr-1.7.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/GridHelpers.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/OtherHelpers.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/FilterDateTypeSelect.js")" type="text/javascript"></script>
    @Html.DevExpress().GetScripts(
                    new DevExpress.Web.Mvc.UI.Script { ExtensionSuite = ExtensionSuite.NavigationAndLayout },
                    new DevExpress.Web.Mvc.UI.Script { ExtensionSuite = ExtensionSuite.Editors },
                    new DevExpress.Web.Mvc.UI.Script { ExtensionSuite = ExtensionSuite.HtmlEditor },
                    new DevExpress.Web.Mvc.UI.Script { ExtensionSuite = ExtensionSuite.GridView })
    @Html.DevExpress().GetStyleSheets(
                                new DevExpress.Web.Mvc.UI.StyleSheet { ExtensionSuite = ExtensionSuite.GridView, Theme = "DevEx" },
                                new DevExpress.Web.Mvc.UI.StyleSheet { ExtensionSuite = ExtensionSuite.HtmlEditor, Theme = "DevEx" },
                                new DevExpress.Web.Mvc.UI.StyleSheet { ExtensionSuite = ExtensionSuite.Editors, Theme = "DevEx" },
                                new DevExpress.Web.Mvc.UI.StyleSheet { ExtensionSuite = ExtensionSuite.NavigationAndLayout, Theme = "DevEx" })
</head>

<body>
<div class="container">
    <script type="text/javascript">
        function OnMainItemClick(s, e) {
            if (e.item.name == 'Documentation') {
                window.open("http://" + document.location.host + "/Help/ImportDonneesRH.pdf", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "CompanyXLSDemo") {
                window.open("http://" + document.location.host + "/Help/SiegeSocial.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "EnterpriseXLSDemo") {
                window.open("http://" + document.location.host + "/Help/Etablissement.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "ExtEntrprXLSDemo") {
                window.open("http://" + document.location.host + "/Help/EntreprisesExterieures.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "HierarchyXLSDemo") {
                window.open("http://" + document.location.host + "/Help/Hierarchie.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "PersonnelXLSDemo") {
                window.open("http://" + document.location.host + "/Help/Personne.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "PersonnelHoursXLSDemo") {
                window.open("http://" + document.location.host + "/Help/HeuresTravailleesPersonne.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
            else if (e.item.name == "HierarchyHoursXLSDemo") {
                window.open("http://" + document.location.host + "/Help/HeuresTravailleesHierarchie.xls", null, "menubar=1,resizable=1,scrollbars=1,width=650,height=450", null);
            }
        }
    </script>
    @Html.DevExpress().Image(settings => 
    {
        settings.ImageUrl = "~/App_Themes/E-Import RH.png";
        settings.Width = Unit.Percentage(100);
    }).GetHtml()
    @Html.DevExpress().Menu(settings => 
    {
        settings.Name = "HeaderMenu";
        settings.Width = Unit.Percentage(100);
        settings.ItemLinkMode = DevExpress.Web.ASPxClasses.ItemLinkMode.TextOnly;
        settings.EnableHotTrack = true;
        settings.ShowPopOutImages = DevExpress.Utils.DefaultBoolean.False;
        settings.EnableClientSideAPI = true;
        settings.EnableHotTrack = true;
        settings.ClientSideEvents.ItemClick = "OnMainItemClick";
        if (((RPSImporter.Models.User)this.Session["currentUser"]).IsAdmin)
        {
           settings.Items.Add(item =>
           {
              item.Name = "ConfigureMain";
              item.Text = "Configurer";
              item.Items.Add(subitem =>
              {
                 subitem.Name = "UserMain";
                 subitem.Text = "Utilisateurs";
                 subitem.NavigateUrl = "~/User/";
              });
              item.Items.Add(subitem =>
              {
                 subitem.Name = "SettingsMain";
                 subitem.Text = "Préférences";
                 subitem.NavigateUrl = "~/Home/ViewSettings";
              });
           });
        }
        settings.Items.Add(item =>
        {
            item.Name = "ImportMain";
            item.Text = "Importation";
            item.Items.Add(subItem =>
            {
                subItem.Name = "ImportFile";
                subItem.Text = "Importer Fichier";
                subItem.NavigateUrl = "~/Home/ImportFile";
            });
            item.Items.Add(subItem =>
            {
                subItem.Name = "ImportFtp";
                subItem.Text = "Importer FTP";
                subItem.NavigateUrl = "~/Home/ImportFtpView";
            });            
        });
        settings.Items.Add(item => {
            item.Name = "helpMain";
            item.Text = "Aide";
            item.Items.Add(subitem => 
            {
                subitem.Name = "Documentation";
                subitem.Text = "Documentation";
                //subitem.NavigateUrl = "#";                
            });
            item.Items.Add(subitem => 
            {
                subitem.Name = "DemoFiles";
                subitem.Text = "Exemples XLS";
                subitem.Items.Add(thirditem => 
                {
                    thirditem.Name = "CompanyXLSDemo";
                    thirditem.Text = "Exemple Fichier Siège social";
                    //thirditem.NavigateUrl = "#";
                });
                subitem.Items.Add(thirditem =>
                {
                    thirditem.Name = "EnterpriseXLSDemo";
                    thirditem.Text = "Exemple Fichier Etablissement";
                    //thirditem.NavigateUrl = "#";
                });
                subitem.Items.Add(thirditem =>
                {
                    thirditem.Name = "ExtEntrprXLSDemo";
                    thirditem.Text = "Exemple Fichier Entreprises Extérieures";
                    //thirditem.NavigateUrl = "#";
                });
                subitem.Items.Add(thirditem =>
                {
                    thirditem.Name = "HierarchyXLSDemo";
                    thirditem.Text = "Exemple Fichier Organisation Fonctionnelle";
                    //thirditem.NavigateUrl = "#";
                });
                subitem.Items.Add(thirditem =>
                {
                    thirditem.Name = "PersonnelXLSDemo";
                    thirditem.Text = "Exemple Fichier Personne";
                    //thirditem.NavigateUrl = "#";
                });
                subitem.Items.Add(thirditem =>
                {
                    thirditem.Name = "PersonnelHoursXLSDemo";
                    thirditem.Text = "Exemple Fichier Heures Travaillées par Personne";
                    //thirditem.NavigateUrl = "#";
                });
                subitem.Items.Add(thirditem =>
                {
                    thirditem.Name = "HierarchyHoursXLSDemo";
                    thirditem.Text = "Exemple Fichier Heures Travaillées par Niveau Hiérqrchique";
                    //thirditem.NavigateUrl = "#";
                });
            });
        });
        settings.Items.Add(item => 
        { 
            item.Name = "LogOutMain";
            item.Text = "Déconnexion";
            item.NavigateUrl = Url.Action("LogOut", "Home");
        });
    }).GetHtml()
    @RenderBody()
</div>

</body>
</html>
